#! /bin/sh -vx
# $Id: etriptest.test 45809 2017-11-15 00:36:56Z karl $
# Copyright 2017 Karl Berry <tex-live@tug.org>
# Copyright 2009-2014 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.

testdir=$abs_srcdir/triptrap
+ testdir=SRCDIR/triptrap
etestdir=$abs_srcdir/etexdir/etrip
+ etestdir=SRCDIR/etexdir/etrip

TEXMFCNF=$etestdir; export TEXMFCNF
+ TEXMFCNF=SRCDIR/etexdir/etrip
+ export TEXMFCNF

rm -rf etripdir
+ rm -rf etripdir
mkdir etripdir
+ mkdir etripdir
cd etripdir
+ cd etripdir

dvitype_args="-output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*'"
+ dvitype_args='-output-level=2 -dpi=72.27 -page-start='\''*.*.*.*.*.*.*.*.*.*'\'''

echo ">>> Running e-TRIP test for e-TeX." >&2
+ echo '>>> Running e-TRIP test for e-TeX.'
>>> Running e-TRIP test for e-TeX.
echo ">>> See $etestdir/etrip.diffs for example of acceptable diffs." >&2
+ echo '>>> See SRCDIR/etexdir/etrip/etrip.diffs for example of acceptable diffs.'
>>> See SRCDIR/etexdir/etrip/etrip.diffs for example of acceptable diffs.

is_OK=:
+ is_OK=:

set -x
+ set -x

echo "*** TRIP test for e-TeX in compatibility mode ***."
+ echo '*** TRIP test for e-TeX in compatibility mode ***.'
*** TRIP test for e-TeX in compatibility mode ***.

./pltotf $testdir/trip.pl trip.tfm || exit 1
+ ./pltotf SRCDIR/triptrap/trip.pl trip.tfm

./tftopl ./trip.tfm trip.pl || exit 1
+ ./tftopl ./trip.tfm trip.pl

diff $testdir/trip.pl trip.pl || is_OK=false
+ diff SRCDIR/triptrap/trip.pl trip.pl

# get same filename in log
$LN_S $testdir/trip.tex .
+ ln -s SRCDIR/triptrap/trip.tex .

./etex --progname=einitex --ini <$testdir/trip1.in >ctripin.fot
+ ./etex --progname=einitex --ini
if test ! -s trip.fmt; then
  echo "*** trip.fmt not created by trip1.in, investigate!" >&2
  exit 1
fi
+ test '!' -s trip.fmt
mv trip.log ctripin.log || exit 1
+ mv trip.log ctripin.log
diff $testdir/tripin.log ctripin.log
+ diff SRCDIR/triptrap/tripin.log ctripin.log
1c1
< This is TeX, Version 3.141592653 (INITEX)  4 JUL 1776 12:00
---
> This is e-TeX, Version 3.141592653-2.6 (TeX Live 2021/dev) (INITEX)  27 JAN 2021 18:01
3c3
< (trip.tex
---
> (./trip.tex
450,453c450,453
<  (preloaded format=trip 1776.7.4)
< 1326 strings of total length 23633
< 471 memory locations dumped; current usage is 96&278
< 341 multiletter control sequences
---
>  (preloaded format=trip 2021.1.27)
> 1491 strings of total length 26266
> 479 memory locations dumped; current usage is 104&278
> 342 multiletter control sequences
461c461
< Hyphenation trie of length 273 has 9 ops out of 500
---
> Hyphenation trie of length 273 has 9 ops out of 35111

# May as well test non-ini second time through.
./etex --progname=etex <$testdir/trip2.in >ctrip.fot
+ ./etex --progname=etex
mv trip.log ctrip.log
+ mv trip.log ctrip.log
diff $testdir/trip.fot ctrip.fot
+ diff SRCDIR/triptrap/trip.fot ctrip.fot
1,3c1,2
< This is TeX, Version 3.141592653 (INITEX)
< ** &trip  trip 
< (trip.tex ##
---
> This is e-TeX, Version 3.141592653-2.6 (TeX Live 2021/dev) (preloaded format=etex)
> **(./trip.tex ##
17c16
< Memory usage before: 159&313; after: 102&278; still untouched: 1613
---
> Memory usage before: 185&313; after: 112&278; still untouched: 2612
75c74
< Memory usage before: 334&431; after: 292&418; still untouched: 175
---
> Memory usage before: 434&431; after: 376&418; still untouched: 178

# We use $DIFF instead of `diff' only for those files where there
# might actually be legitimate numerical differences.
$DIFF $DIFFFLAGS $testdir/trip.log ctrip.log
+ diff SRCDIR/triptrap/trip.log ctrip.log
1c1
< This is TeX, Version 3.141592653 (preloaded format=trip 1776.7.4)  4 JUL 1776 12:00
---
> This is e-TeX, Version 3.141592653-2.6 (TeX Live 2021/dev) (preloaded format=trip 2021.1.27)  27 JAN 2021 18:01
3c3
< (trip.tex ##
---
> (./trip.tex ##
73c73
< Memory usage before: 159&313; after: 102&278; still untouched: 1613
---
> Memory usage before: 185&313; after: 112&278; still untouched: 2612
642c642
< Memory usage before: 747&484; after: 581&481; still untouched: 1492
---
> Memory usage before: 1027&484; after: 795&481; still untouched: 1491
815c815
< Memory usage before: 475&470; after: 290&466; still untouched: 1473
---
> Memory usage before: 653&470; after: 384&466; still untouched: 1472
915c915
< Memory usage before: 218&459; after: 149&458; still untouched: 1473
---
> Memory usage before: 286&459; after: 181&458; still untouched: 1472
1070c1070
< Memory usage before: 118&328; after: 102&328; still untouched: 1473
---
> Memory usage before: 132&328; after: 110&328; still untouched: 1472
1405c1405
< \vbox(16383.99998+0.0)x1000.0, glue set 16342.0fil
---
> \vbox(16383.99998+0.0)x1000.0, glue set 16341.99998fil
1511c1511
< Memory usage before: 990&376; after: 584&370; still untouched: 735
---
> Memory usage before: 1396&376; after: 788&370; still untouched: 1472
1954c1954
< (tripos.tex
---
> (./tripos.tex
2018c2018
< \vbox(16383.99998+1.0)x100.0, glue set 16239.0fil
---
> \vbox(16383.99998+1.0)x100.0, glue set 16238.99998fil
2189c2189
< Memory usage before: 950&531; after: 546&448; still untouched: 706
---
> Memory usage before: 1400&531; after: 772&448; still untouched: 1443
2533c2533
< \vbox(16383.99998+0.0)x20.0, glue set 16331.0fil
---
> \vbox(16383.99998+0.0)x20.0, glue set 16330.99998fil
2575c2575
< Memory usage before: 339&413; after: 236&405; still untouched: 706
---
> Memory usage before: 455&413; after: 296&405; still untouched: 1443
3326c3326
< \vbox(10000.0+2.0)x28.0, glue set 9737.58789fil
---
> \vbox(10000.0+2.0)x28.0, glue set 9737.58742fil
3616c3616
< Memory usage before: 2170&521; after: 1181&459; still untouched: 175
---
> Memory usage before: 3016&521; after: 1607&459; still untouched: 178
3864c3864
< \vbox(16383.99998+2.0)x100.0, glue set 16318.0fil
---
> \vbox(16383.99998+2.0)x100.0, glue set 16317.99997fil
3951c3951
< Memory usage before: 640&415; after: 397&410; still untouched: 175
---
> Memory usage before: 888&415; after: 525&410; still untouched: 178
4034c4034
< \vbox(16383.99998+0.0)x8236.0, glue set 16344.0fil
---
> \vbox(16383.99998+0.0)x8236.0, glue set 16343.99998fil
4053c4053
< Memory usage before: 235&401; after: 178&399; still untouched: 175
---
> Memory usage before: 307&401; after: 218&399; still untouched: 178
4420c4420
< \vbox(16383.99998+0.0)x100.0, glue set 16332.0fil
---
> \vbox(16383.99998+0.0)x100.0, glue set 16331.99998fil
4506c4506
< Memory usage before: 651&432; after: 417&418; still untouched: 175
---
> Memory usage before: 941&432; after: 565&418; still untouched: 178
4742c4742
< \vbox(16383.99998+0.0)x205.12613, glue set 16344.0fil
---
> \vbox(16383.99998+0.0)x205.12613, glue set 16343.99998fil
4828c4828
< Memory usage before: 776&458; after: 464&452; still untouched: 175
---
> Memory usage before: 1098&458; after: 630&452; still untouched: 178
6381c6381
< (tripos.tex
---
> (./tripos.tex
6596c6596
< Memory usage before: 819&428; after: 720&426; still untouched: 175
---
> Memory usage before: 1155&428; after: 1016&426; still untouched: 178
7156c7156
< Memory usage before: 895&439; after: 290&420; still untouched: 175
---
> Memory usage before: 1269&439; after: 374&420; still untouched: 178
7289c7289
< Memory usage before: 334&431; after: 292&418; still untouched: 175
---
> Memory usage before: 434&431; after: 376&418; still untouched: 178
7297,7300c7297,7300
<  47 strings out of 1674
<  253 string characters out of 8367
<  2825 words of memory out of 3000
<  372 multiletter control sequences out of 2100
---
>  44 strings out of 1809
>  261 string characters out of 7734
>  3821 words of memory out of 3999
>  373 multiletter control sequences out of 15000+0
7302c7302
<  2 hyphenation exceptions out of 307
---
>  1 hyphenation exception out of 659

mv tripos.tex ctripos.tex
+ mv tripos.tex ctripos.tex
diff $testdir/tripos.tex ctripos.tex
+ diff SRCDIR/triptrap/tripos.tex ctripos.tex

eval ./dvitype $dvitype_args trip.dvi >ctrip.typ || exit 1
+ eval ./dvitype -output-level=2 -dpi=72.27 '-page-start='\''*.*.*.*.*.*.*.*.*.*'\''' trip.dvi
./dvitype -output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*' trip.dvi
++ ./dvitype -output-level=2 -dpi=72.27 '-page-start=*.*.*.*.*.*.*.*.*.*' trip.dvi
$DIFF $DIFFFLAGS $testdir/trip.typ ctrip.typ
+ diff SRCDIR/triptrap/trip.typ ctrip.typ
1c1
< This is DVItype, Version 3.6
---
> This is DVItype, Version 3.6 (TeX Live 2021/dev)
9c9
< ' TeX output 1776.07.04:1200'
---
> ' TeX output 2021.01.27:1801'
419c419
< 1121: down4 639342208 
---
> 1121: down4 639342177 
1087,1088c1087,1088
< 2535: y4 203921760 
< 2540: y0 203921760 
---
> 2535: y4 203921756 
> 2540: y0 203921756 

mv trip.fmt ctrip.fmt
+ mv trip.fmt ctrip.fmt

# ==============================

echo "*** TRIP test for e-TeX in extended mode ***."
+ echo '*** TRIP test for e-TeX in extended mode ***.'
*** TRIP test for e-TeX in extended mode ***.

./etex --progname=einitex --ini <$etestdir/etrip1.in >xtripin.fot
+ ./etex --progname=einitex --ini
if test ! -s trip.fmt; then
  echo "*** trip.fmt not created by etrip1.in, investigate!" >&2
  exit 1
fi
+ test '!' -s trip.fmt
mv trip.log xtripin.log || exit 1
+ mv trip.log xtripin.log
diff ctripin.log xtripin.log
+ diff ctripin.log xtripin.log
2c2,3
< **\input trip
---
> entering extended mode
> ***\input trip
36,41d36
< ! Bad register code (256).
< l.29 ...{1} \toksdef\tokens=256 
<                                 \show\errorstopmode
< A register number must be between 0 and 255.
< I changed this one to zero.
< 
452,453c447,448
< 479 memory locations dumped; current usage is 104&278
< 342 multiletter control sequences
---
> 517 memory locations dumped; current usage is 142&278
> 408 multiletter control sequences

# May as well test non-ini second time through.
./etex --progname=etex <$etestdir/trip2.in >xtrip.fot
+ ./etex --progname=etex
mv trip.log xtrip.log
+ mv trip.log xtrip.log
diff ctrip.fot xtrip.fot
+ diff ctrip.fot xtrip.fot
2c2,3
< **(./trip.tex ##
---
> **entering extended mode
> ## (./trip.tex
16c17
< Memory usage before: 185&313; after: 112&278; still untouched: 2612
---
> Memory usage before: 185&313; after: 112&278; still untouched: 1612
76a78,80
> 
> ### semi simple group (level 1) entered at line 429 (begingroup)
> ### bottom level

# We use $DIFF instead of `diff' only for those files where there
# might actually be legitimate numerical differences.
$DIFF $DIFFFLAGS ctrip.log xtrip.log
+ diff ctrip.log xtrip.log
2,3c2,4
< ** &trip  trip
< (./trip.tex ##
---
> entering extended mode
> **&trip \toksdef\tokens=0 \input trip
>  (./trip.tex
73c74
< Memory usage before: 185&313; after: 112&278; still untouched: 2612
---
> Memory usage before: 185&313; after: 112&278; still untouched: 1612
1769d1769
< {restoring \fam=-1}
1779d1778
< {restoring \displayindent=0.0pt}
1833d1831
< {restoring \fam=-1}
2135c2133
< .\hbox(0.0+0.0)x0.0, shifted 50.0
---
> .\hbox(0.0+0.0)x0.0, shifted 50.0, display
2138c2136
< .\hbox(0.0+0.0)x0.0, shifted 100.0
---
> .\hbox(0.0+0.0)x0.0, shifted 100.0, display
2570c2568
< .\hbox(0.0+0.0)x15.0, glue set 0.1875, shifted 5.0
---
> .\hbox(0.0+0.0)x15.0, glue set 0.1875, shifted 5.0, display
2835d2832
< {restoring current font=\ip}
3223d3219
< {restoring \fam=-1}
3372c3368
< .\hbox(68.26251+98.15005)x19.0, glue set - 1.0, shifted 9.0
---
> .\hbox(68.26251+98.15005)x19.0, glue set - 1.0, shifted 9.0, display
3557c3553
< .\hbox(20.5+50.80002)x8.27895, shifted 19.72105
---
> .\hbox(20.5+50.80002)x8.27895, shifted 19.72105, display
3766d3761
< {restoring \fam=-1}
3839d3833
< {restoring \fam=-1}
3895c3889
< ..\hbox(12.0+4.0)x8.1778
---
> ..\hbox(12.0+4.0)x8.1778, display
3917c3911
< ..\hbox(0.0+13.00002)x-0.1778, glue set - 57.67767fil
---
> ..\hbox(0.0+13.00002)x-0.1778, glue set - 57.67767fil, display
3925c3919
< ....\hbox(7.0+1.0)x5.0, shifted 47.5
---
> ....\hbox(7.0+1.0)x5.0, shifted 47.5, display
4011d4004
< {restoring \fam=-1}
4047c4040
< .\hbox(0.0+0.0)x1009.0, shifted 7227.0
---
> .\hbox(0.0+0.0)x1009.0, shifted 7227.0, display
4051c4044
< .\hbox(0.0+0.0)x-7127.0, shifted 7227.0
---
> .\hbox(0.0+0.0)x-7127.0, shifted 7227.0, display
4845c4838
< I'll pretend you didn't say \long or \outer or \global.
---
> I'll pretend you didn't say \long or \outer or \global or \protected.
7292a7286,7288
> 
> ### semi simple group (level 1) entered at line 429 (begingroup)
> ### bottom level
7300c7296
<  373 multiletter control sequences out of 15000+0
---
>  439 multiletter control sequences out of 15000+0
7303c7299
<  7i,7n,9p,113b,38s stack positions out of 200i,40n,60p,500b,600s
---
>  7i,7n,9p,136b,40s stack positions out of 200i,40n,60p,500b,600s

mv tripos.tex xtripos.tex
+ mv tripos.tex xtripos.tex
diff $testdir/tripos.tex xtripos.tex
+ diff SRCDIR/triptrap/tripos.tex xtripos.tex

eval ./dvitype $dvitype_args trip.dvi >xtrip.typ || exit 1
+ eval ./dvitype -output-level=2 -dpi=72.27 '-page-start='\''*.*.*.*.*.*.*.*.*.*'\''' trip.dvi
./dvitype -output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*' trip.dvi
++ ./dvitype -output-level=2 -dpi=72.27 '-page-start=*.*.*.*.*.*.*.*.*.*' trip.dvi
$DIFF $DIFFFLAGS ctrip.typ xtrip.typ
+ diff ctrip.typ xtrip.typ

mv trip.fmt xtrip.fmt
+ mv trip.fmt xtrip.fmt

# ==============================

echo "*** e-TeX specific part of e-TRIP test ***."
+ echo '*** e-TeX specific part of e-TRIP test ***.'
*** e-TeX specific part of e-TRIP test ***.

./pltotf $etestdir/etrip.pl etrip.tfm || exit 1
+ ./pltotf SRCDIR/etexdir/etrip/etrip.pl etrip.tfm

./tftopl ./etrip.tfm etrip.pl || exit 1
+ ./tftopl ./etrip.tfm etrip.pl

diff $etestdir/etrip.pl etrip.pl || is_OK=false
+ diff SRCDIR/etexdir/etrip/etrip.pl etrip.pl

# get same filename in log
$LN_S $etestdir/etrip.tex .
+ ln -s SRCDIR/etexdir/etrip/etrip.tex .

./etex --progname=einitex --ini <$etestdir/etrip2.in >etripin.fot
+ ./etex --progname=einitex --ini
if test ! -s etrip.fmt; then
  echo "*** etrip.fmt not created by etrip2.in, investigate!" >&2
  exit 1
fi
+ test '!' -s etrip.fmt
mv etrip.log etripin.log || exit 1
+ mv etrip.log etripin.log
diff $etestdir/etripin.log etripin.log
+ diff SRCDIR/etexdir/etrip/etripin.log etripin.log
1c1
< This is e-TeX, Version 3.14159265-2.6 (TeX Live 2014) (INITEX)  22 JAN 2014 11:25
---
> This is e-TeX, Version 3.141592653-2.6 (TeX Live 2021/dev) (INITEX)  27 JAN 2021 18:01
26,27c26,27
<  (preloaded format=etrip 2014.1.22)
< 1491 strings of total length 26258
---
>  (preloaded format=etrip 2021.1.27)
> 1492 strings of total length 26297

# May as well test non-ini second time through.
./etex --progname=etex <$etestdir/etrip3.in >etrip.fot
+ ./etex --progname=etex
diff $etestdir/etrip.fot etrip.fot
+ diff SRCDIR/etexdir/etrip/etrip.fot etrip.fot
1c1
< This is e-TeX, Version 3.14159265-2.6 (TeX Live 2014) (preloaded format=etex)
---
> This is e-TeX, Version 3.141592653-2.6 (TeX Live 2021/dev) (preloaded format=etex)
45,46d44
< 
< \openout1 = `etrip.out'.

# We use $DIFF instead of `diff' only for those files where there
# might actually be legitimate numerical differences.
$DIFF $DIFFFLAGS $etestdir/etrip.log etrip.log
+ diff SRCDIR/etexdir/etrip/etrip.log etrip.log
1c1
< This is e-TeX, Version 3.14159265-2.6 (TeX Live 2014) (preloaded format=etrip 2014.1.22)  22 JAN 2014 11:25
---
> This is e-TeX, Version 3.141592653-2.6 (TeX Live 2021/dev) (preloaded format=etrip 2021.1.27)  27 JAN 2021 18:01
692,693d691
< \openout1 = `etrip.out'.
< 
1426c1424
< this will be denominator of:
---
> this will begin denominator of:
1450c1448
< this will be denominator of:
---
> this will begin denominator of:
1497c1495
< this will be denominator of:
---
> this will begin denominator of:
1545c1543
< this will be denominator of:
---
> this will begin denominator of:
4421,4422c4419,4420
<  19 strings out of 1809
<  145 string characters out of 7742
---
>  19 strings out of 1808
>  145 string characters out of 7703

diff $etestdir/etrip.out etrip.out
+ diff SRCDIR/etexdir/etrip/etrip.out etrip.out

eval ./dvitype $dvitype_args etrip.dvi >etrip.typ || exit 1
+ eval ./dvitype -output-level=2 -dpi=72.27 '-page-start='\''*.*.*.*.*.*.*.*.*.*'\''' etrip.dvi
./dvitype -output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*' etrip.dvi
++ ./dvitype -output-level=2 -dpi=72.27 '-page-start=*.*.*.*.*.*.*.*.*.*' etrip.dvi
$DIFF $DIFFFLAGS $etestdir/etrip.typ etrip.typ
+ diff SRCDIR/etexdir/etrip/etrip.typ etrip.typ
1c1
< This is DVItype, Version 3.6 (TeX Live 2014)
---
> This is DVItype, Version 3.6 (TeX Live 2021/dev)
9c9
< ' TeX output 2014.01.22:1125'
---
> ' TeX output 2021.01.27:1801'

$is_OK || {
  echo ">>> There were some errors." >&2
  exit 1
}
+ :

PASS etexdir/etriptest.test (exit status: 0)
PASS: etexdir/etriptest.test
